//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS AppIntegrations service.
///
///    Amazon AppIntegrations actions     Amazon AppIntegrations data types    The Amazon AppIntegrations service enables you to configure and reuse connections to external applications. For information about how you can use external applications with Amazon Connect, see the following topics in the Amazon Connect Administrator Guide:    Third-party applications (3p apps) in the agent workspace     Use Amazon Q in Connect for generative AI–powered agent assistance in real-time
public struct AppIntegrations: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the AppIntegrations client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "AppIntegrations",
            serviceIdentifier: "app-integrations",
            serviceProtocol: .restjson,
            apiVersion: "2020-07-29",
            endpoint: endpoint,
            errorType: AppIntegrationsErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Creates and persists an Application resource.
    @Sendable
    @inlinable
    public func createApplication(_ input: CreateApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateApplicationResponse {
        try await self.client.execute(
            operation: "CreateApplication", 
            path: "/applications", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates and persists an Application resource.
    ///
    /// Parameters:
    ///   - applicationConfig: The configuration settings for the application.
    ///   - applicationSourceConfig: The configuration for where the application should be loaded from.
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - description: The description of the application.
    ///   - iframeConfig: The iframe configuration for the application.
    ///   - initializationTimeout: The maximum time in milliseconds allowed to establish a connection with the workspace.
    ///   - isService: Indicates whether the application is a service.
    ///   - name: The name of the application.
    ///   - namespace: The namespace of the application.
    ///   - permissions: The configuration of events or requests that the application has access to.
    ///   - tags: The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
    ///   - logger: Logger use during operation
    @inlinable
    public func createApplication(
        applicationConfig: ApplicationConfig? = nil,
        applicationSourceConfig: ApplicationSourceConfig,
        clientToken: String? = CreateApplicationRequest.idempotencyToken(),
        description: String? = nil,
        iframeConfig: IframeConfig? = nil,
        initializationTimeout: Int? = nil,
        isService: Bool? = nil,
        name: String,
        namespace: String,
        permissions: [String]? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateApplicationResponse {
        let input = CreateApplicationRequest(
            applicationConfig: applicationConfig, 
            applicationSourceConfig: applicationSourceConfig, 
            clientToken: clientToken, 
            description: description, 
            iframeConfig: iframeConfig, 
            initializationTimeout: initializationTimeout, 
            isService: isService, 
            name: name, 
            namespace: namespace, 
            permissions: permissions, 
            tags: tags
        )
        return try await self.createApplication(input, logger: logger)
    }

    /// Creates and persists a DataIntegration resource.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated. Use a different DataIntegration, or recreate the DataIntegration using the CreateDataIntegration API.
    @Sendable
    @inlinable
    public func createDataIntegration(_ input: CreateDataIntegrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDataIntegrationResponse {
        try await self.client.execute(
            operation: "CreateDataIntegration", 
            path: "/dataIntegrations", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates and persists a DataIntegration resource.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated. Use a different DataIntegration, or recreate the DataIntegration using the CreateDataIntegration API.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - description: A description of the DataIntegration.
    ///   - fileConfiguration: The configuration for what files should be pulled from the source.
    ///   - kmsKey: The KMS key ARN for the DataIntegration.
    ///   - name: The name of the DataIntegration.
    ///   - objectConfiguration: The configuration for what data should be pulled from the source.
    ///   - scheduleConfig: The name of the data and how often it should be pulled from the source.
    ///   - sourceURI: The URI of the data source.
    ///   - tags: The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
    ///   - logger: Logger use during operation
    @inlinable
    public func createDataIntegration(
        clientToken: String? = CreateDataIntegrationRequest.idempotencyToken(),
        description: String? = nil,
        fileConfiguration: FileConfiguration? = nil,
        kmsKey: String,
        name: String,
        objectConfiguration: [String: [String: [String]]]? = nil,
        scheduleConfig: ScheduleConfiguration? = nil,
        sourceURI: String? = nil,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDataIntegrationResponse {
        let input = CreateDataIntegrationRequest(
            clientToken: clientToken, 
            description: description, 
            fileConfiguration: fileConfiguration, 
            kmsKey: kmsKey, 
            name: name, 
            objectConfiguration: objectConfiguration, 
            scheduleConfig: scheduleConfig, 
            sourceURI: sourceURI, 
            tags: tags
        )
        return try await self.createDataIntegration(input, logger: logger)
    }

    /// Creates and persists a DataIntegrationAssociation resource.
    @Sendable
    @inlinable
    public func createDataIntegrationAssociation(_ input: CreateDataIntegrationAssociationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDataIntegrationAssociationResponse {
        try await self.client.execute(
            operation: "CreateDataIntegrationAssociation", 
            path: "/dataIntegrations/{DataIntegrationIdentifier}/associations", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates and persists a DataIntegrationAssociation resource.
    ///
    /// Parameters:
    ///   - clientAssociationMetadata: The mapping of metadata to be extracted from the data.
    ///   - clientId: The identifier for the client that is associated with the DataIntegration association.
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - dataIntegrationIdentifier: A unique identifier for the DataIntegration.
    ///   - destinationURI: The URI of the data destination.
    ///   - executionConfiguration: The configuration for how the files should be pulled from the source.
    ///   - objectConfiguration: 
    ///   - logger: Logger use during operation
    @inlinable
    public func createDataIntegrationAssociation(
        clientAssociationMetadata: [String: String]? = nil,
        clientId: String? = nil,
        clientToken: String? = CreateDataIntegrationAssociationRequest.idempotencyToken(),
        dataIntegrationIdentifier: String,
        destinationURI: String? = nil,
        executionConfiguration: ExecutionConfiguration? = nil,
        objectConfiguration: [String: [String: [String]]]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDataIntegrationAssociationResponse {
        let input = CreateDataIntegrationAssociationRequest(
            clientAssociationMetadata: clientAssociationMetadata, 
            clientId: clientId, 
            clientToken: clientToken, 
            dataIntegrationIdentifier: dataIntegrationIdentifier, 
            destinationURI: destinationURI, 
            executionConfiguration: executionConfiguration, 
            objectConfiguration: objectConfiguration
        )
        return try await self.createDataIntegrationAssociation(input, logger: logger)
    }

    /// Creates an EventIntegration, given a specified name, description, and a reference to an Amazon EventBridge bus in your account and a partner event source that pushes events to that bus. No objects are created in the your account, only metadata that is persisted on the EventIntegration control plane.
    @Sendable
    @inlinable
    public func createEventIntegration(_ input: CreateEventIntegrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateEventIntegrationResponse {
        try await self.client.execute(
            operation: "CreateEventIntegration", 
            path: "/eventIntegrations", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an EventIntegration, given a specified name, description, and a reference to an Amazon EventBridge bus in your account and a partner event source that pushes events to that bus. No objects are created in the your account, only metadata that is persisted on the EventIntegration control plane.
    ///
    /// Parameters:
    ///   - clientToken: A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.
    ///   - description: The description of the event integration.
    ///   - eventBridgeBus: The EventBridge bus.
    ///   - eventFilter: The event filter.
    ///   - name: The name of the event integration.
    ///   - tags: The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
    ///   - logger: Logger use during operation
    @inlinable
    public func createEventIntegration(
        clientToken: String? = CreateEventIntegrationRequest.idempotencyToken(),
        description: String? = nil,
        eventBridgeBus: String,
        eventFilter: EventFilter,
        name: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateEventIntegrationResponse {
        let input = CreateEventIntegrationRequest(
            clientToken: clientToken, 
            description: description, 
            eventBridgeBus: eventBridgeBus, 
            eventFilter: eventFilter, 
            name: name, 
            tags: tags
        )
        return try await self.createEventIntegration(input, logger: logger)
    }

    /// Deletes the Application. Only Applications that don't have any Application Associations can be deleted.
    @Sendable
    @inlinable
    public func deleteApplication(_ input: DeleteApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteApplicationResponse {
        try await self.client.execute(
            operation: "DeleteApplication", 
            path: "/applications/{Arn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the Application. Only Applications that don't have any Application Associations can be deleted.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the Application.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteApplication(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteApplicationResponse {
        let input = DeleteApplicationRequest(
            arn: arn
        )
        return try await self.deleteApplication(input, logger: logger)
    }

    /// Deletes the DataIntegration. Only DataIntegrations that don't have any DataIntegrationAssociations can be deleted. Deleting a DataIntegration also deletes the underlying Amazon AppFlow flow and service linked role.   You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    @Sendable
    @inlinable
    public func deleteDataIntegration(_ input: DeleteDataIntegrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteDataIntegrationResponse {
        try await self.client.execute(
            operation: "DeleteDataIntegration", 
            path: "/dataIntegrations/{DataIntegrationIdentifier}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the DataIntegration. Only DataIntegrations that don't have any DataIntegrationAssociations can be deleted. Deleting a DataIntegration also deletes the underlying Amazon AppFlow flow and service linked role.   You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    ///
    /// Parameters:
    ///   - dataIntegrationIdentifier: A unique identifier for the DataIntegration.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteDataIntegration(
        dataIntegrationIdentifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteDataIntegrationResponse {
        let input = DeleteDataIntegrationRequest(
            dataIntegrationIdentifier: dataIntegrationIdentifier
        )
        return try await self.deleteDataIntegration(input, logger: logger)
    }

    /// Deletes the specified existing event integration. If the event integration is associated with clients, the request is rejected.
    @Sendable
    @inlinable
    public func deleteEventIntegration(_ input: DeleteEventIntegrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteEventIntegrationResponse {
        try await self.client.execute(
            operation: "DeleteEventIntegration", 
            path: "/eventIntegrations/{Name}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified existing event integration. If the event integration is associated with clients, the request is rejected.
    ///
    /// Parameters:
    ///   - name: The name of the event integration.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteEventIntegration(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteEventIntegrationResponse {
        let input = DeleteEventIntegrationRequest(
            name: name
        )
        return try await self.deleteEventIntegration(input, logger: logger)
    }

    /// Get an Application resource.
    @Sendable
    @inlinable
    public func getApplication(_ input: GetApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetApplicationResponse {
        try await self.client.execute(
            operation: "GetApplication", 
            path: "/applications/{Arn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Get an Application resource.
    ///
    /// Parameters:
    ///   - arn: The Amazon Resource Name (ARN) of the Application.
    ///   - logger: Logger use during operation
    @inlinable
    public func getApplication(
        arn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetApplicationResponse {
        let input = GetApplicationRequest(
            arn: arn
        )
        return try await self.getApplication(input, logger: logger)
    }

    /// Returns information about the DataIntegration.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    @Sendable
    @inlinable
    public func getDataIntegration(_ input: GetDataIntegrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetDataIntegrationResponse {
        try await self.client.execute(
            operation: "GetDataIntegration", 
            path: "/dataIntegrations/{Identifier}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about the DataIntegration.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    ///
    /// Parameters:
    ///   - identifier: A unique identifier.
    ///   - logger: Logger use during operation
    @inlinable
    public func getDataIntegration(
        identifier: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetDataIntegrationResponse {
        let input = GetDataIntegrationRequest(
            identifier: identifier
        )
        return try await self.getDataIntegration(input, logger: logger)
    }

    /// Returns information about the event integration.
    @Sendable
    @inlinable
    public func getEventIntegration(_ input: GetEventIntegrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetEventIntegrationResponse {
        try await self.client.execute(
            operation: "GetEventIntegration", 
            path: "/eventIntegrations/{Name}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns information about the event integration.
    ///
    /// Parameters:
    ///   - name: The name of the event integration.
    ///   - logger: Logger use during operation
    @inlinable
    public func getEventIntegration(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetEventIntegrationResponse {
        let input = GetEventIntegrationRequest(
            name: name
        )
        return try await self.getEventIntegration(input, logger: logger)
    }

    /// Returns a paginated list of application associations for an application.
    @Sendable
    @inlinable
    public func listApplicationAssociations(_ input: ListApplicationAssociationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApplicationAssociationsResponse {
        try await self.client.execute(
            operation: "ListApplicationAssociations", 
            path: "/applications/{ApplicationId}/associations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a paginated list of application associations for an application.
    ///
    /// Parameters:
    ///   - applicationId: A unique identifier for the Application.
    ///   - maxResults: The maximum number of results to return per page.
    ///   - nextToken: The token for the next set of results. Use the value returned in the previous
    ///   - logger: Logger use during operation
    @inlinable
    public func listApplicationAssociations(
        applicationId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApplicationAssociationsResponse {
        let input = ListApplicationAssociationsRequest(
            applicationId: applicationId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listApplicationAssociations(input, logger: logger)
    }

    /// Lists applications in the account.
    @Sendable
    @inlinable
    public func listApplications(_ input: ListApplicationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApplicationsResponse {
        try await self.client.execute(
            operation: "ListApplications", 
            path: "/applications", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists applications in the account.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to return per page.
    ///   - nextToken: The token for the next set of results. Use the value returned in the previous
    ///   - logger: Logger use during operation
    @inlinable
    public func listApplications(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApplicationsResponse {
        let input = ListApplicationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listApplications(input, logger: logger)
    }

    /// Returns a paginated list of DataIntegration associations in the account.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    @Sendable
    @inlinable
    public func listDataIntegrationAssociations(_ input: ListDataIntegrationAssociationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDataIntegrationAssociationsResponse {
        try await self.client.execute(
            operation: "ListDataIntegrationAssociations", 
            path: "/dataIntegrations/{DataIntegrationIdentifier}/associations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a paginated list of DataIntegration associations in the account.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    ///
    /// Parameters:
    ///   - dataIntegrationIdentifier: A unique identifier for the DataIntegration.
    ///   - maxResults: The maximum number of results to return per page.
    ///   - nextToken: The token for the next set of results. Use the value returned in the previous
    ///   - logger: Logger use during operation
    @inlinable
    public func listDataIntegrationAssociations(
        dataIntegrationIdentifier: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDataIntegrationAssociationsResponse {
        let input = ListDataIntegrationAssociationsRequest(
            dataIntegrationIdentifier: dataIntegrationIdentifier, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listDataIntegrationAssociations(input, logger: logger)
    }

    /// Returns a paginated list of DataIntegrations in the account.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    @Sendable
    @inlinable
    public func listDataIntegrations(_ input: ListDataIntegrationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListDataIntegrationsResponse {
        try await self.client.execute(
            operation: "ListDataIntegrations", 
            path: "/dataIntegrations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a paginated list of DataIntegrations in the account.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to return per page.
    ///   - nextToken: The token for the next set of results. Use the value returned in the previous
    ///   - logger: Logger use during operation
    @inlinable
    public func listDataIntegrations(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListDataIntegrationsResponse {
        let input = ListDataIntegrationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listDataIntegrations(input, logger: logger)
    }

    /// Returns a paginated list of event integration associations in the account.
    @Sendable
    @inlinable
    public func listEventIntegrationAssociations(_ input: ListEventIntegrationAssociationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListEventIntegrationAssociationsResponse {
        try await self.client.execute(
            operation: "ListEventIntegrationAssociations", 
            path: "/eventIntegrations/{EventIntegrationName}/associations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a paginated list of event integration associations in the account.
    ///
    /// Parameters:
    ///   - eventIntegrationName: The name of the event integration.
    ///   - maxResults: The maximum number of results to return per page.
    ///   - nextToken: The token for the next set of results. Use the value returned in the previous
    ///   - logger: Logger use during operation
    @inlinable
    public func listEventIntegrationAssociations(
        eventIntegrationName: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListEventIntegrationAssociationsResponse {
        let input = ListEventIntegrationAssociationsRequest(
            eventIntegrationName: eventIntegrationName, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listEventIntegrationAssociations(input, logger: logger)
    }

    /// Returns a paginated list of event integrations in the account.
    @Sendable
    @inlinable
    public func listEventIntegrations(_ input: ListEventIntegrationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListEventIntegrationsResponse {
        try await self.client.execute(
            operation: "ListEventIntegrations", 
            path: "/eventIntegrations", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns a paginated list of event integrations in the account.
    ///
    /// Parameters:
    ///   - maxResults: The maximum number of results to return per page.
    ///   - nextToken: The token for the next set of results. Use the value returned in the previous
    ///   - logger: Logger use during operation
    @inlinable
    public func listEventIntegrations(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListEventIntegrationsResponse {
        let input = ListEventIntegrationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listEventIntegrations(input, logger: logger)
    }

    /// Lists the tags for the specified resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the tags for the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Adds the specified tags to the specified resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds the specified tags to the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - tags: The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes the specified tags from the specified resource.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes the specified tags from the specified resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon Resource Name (ARN) of the resource.
    ///   - tagKeys: The tag keys.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates and persists an Application resource.
    @Sendable
    @inlinable
    public func updateApplication(_ input: UpdateApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateApplicationResponse {
        try await self.client.execute(
            operation: "UpdateApplication", 
            path: "/applications/{Arn}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates and persists an Application resource.
    ///
    /// Parameters:
    ///   - applicationConfig: The configuration settings for the application.
    ///   - applicationSourceConfig: The configuration for where the application should be loaded from.
    ///   - arn: The Amazon Resource Name (ARN) of the Application.
    ///   - description: The description of the application.
    ///   - iframeConfig: The iframe configuration for the application.
    ///   - initializationTimeout: The maximum time in milliseconds allowed to establish a connection with the workspace.
    ///   - isService: Indicates whether the application is a service.
    ///   - name: The name of the application.
    ///   - permissions: The configuration of events or requests that the application has access to.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateApplication(
        applicationConfig: ApplicationConfig? = nil,
        applicationSourceConfig: ApplicationSourceConfig? = nil,
        arn: String,
        description: String? = nil,
        iframeConfig: IframeConfig? = nil,
        initializationTimeout: Int? = nil,
        isService: Bool? = nil,
        name: String? = nil,
        permissions: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateApplicationResponse {
        let input = UpdateApplicationRequest(
            applicationConfig: applicationConfig, 
            applicationSourceConfig: applicationSourceConfig, 
            arn: arn, 
            description: description, 
            iframeConfig: iframeConfig, 
            initializationTimeout: initializationTimeout, 
            isService: isService, 
            name: name, 
            permissions: permissions
        )
        return try await self.updateApplication(input, logger: logger)
    }

    /// Updates the description of a DataIntegration.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    @Sendable
    @inlinable
    public func updateDataIntegration(_ input: UpdateDataIntegrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateDataIntegrationResponse {
        try await self.client.execute(
            operation: "UpdateDataIntegration", 
            path: "/dataIntegrations/{Identifier}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the description of a DataIntegration.  You cannot create a DataIntegration association for a DataIntegration that has been previously associated.
    /// Use a different DataIntegration, or recreate the DataIntegration using the
    /// CreateDataIntegration API.
    ///
    /// Parameters:
    ///   - description: A description of the DataIntegration.
    ///   - identifier: A unique identifier for the DataIntegration.
    ///   - name: The name of the DataIntegration.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateDataIntegration(
        description: String? = nil,
        identifier: String,
        name: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateDataIntegrationResponse {
        let input = UpdateDataIntegrationRequest(
            description: description, 
            identifier: identifier, 
            name: name
        )
        return try await self.updateDataIntegration(input, logger: logger)
    }

    /// Updates and persists a DataIntegrationAssociation resource.   Updating a DataIntegrationAssociation with ExecutionConfiguration will rerun the on-demand job.
    @Sendable
    @inlinable
    public func updateDataIntegrationAssociation(_ input: UpdateDataIntegrationAssociationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateDataIntegrationAssociationResponse {
        try await self.client.execute(
            operation: "UpdateDataIntegrationAssociation", 
            path: "/dataIntegrations/{DataIntegrationIdentifier}/associations/{DataIntegrationAssociationIdentifier}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates and persists a DataIntegrationAssociation resource.   Updating a DataIntegrationAssociation with ExecutionConfiguration will rerun the on-demand job.
    ///
    /// Parameters:
    ///   - dataIntegrationAssociationIdentifier: A unique identifier. of the DataIntegrationAssociation resource
    ///   - dataIntegrationIdentifier: A unique identifier for the DataIntegration.
    ///   - executionConfiguration: The configuration for how the files should be pulled from the source.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateDataIntegrationAssociation(
        dataIntegrationAssociationIdentifier: String,
        dataIntegrationIdentifier: String,
        executionConfiguration: ExecutionConfiguration,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateDataIntegrationAssociationResponse {
        let input = UpdateDataIntegrationAssociationRequest(
            dataIntegrationAssociationIdentifier: dataIntegrationAssociationIdentifier, 
            dataIntegrationIdentifier: dataIntegrationIdentifier, 
            executionConfiguration: executionConfiguration
        )
        return try await self.updateDataIntegrationAssociation(input, logger: logger)
    }

    /// Updates the description of an event integration.
    @Sendable
    @inlinable
    public func updateEventIntegration(_ input: UpdateEventIntegrationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateEventIntegrationResponse {
        try await self.client.execute(
            operation: "UpdateEventIntegration", 
            path: "/eventIntegrations/{Name}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the description of an event integration.
    ///
    /// Parameters:
    ///   - description: The description of the event integration.
    ///   - name: The name of the event integration.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateEventIntegration(
        description: String? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateEventIntegrationResponse {
        let input = UpdateEventIntegrationRequest(
            description: description, 
            name: name
        )
        return try await self.updateEventIntegration(input, logger: logger)
    }
}

extension AppIntegrations {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: AppIntegrations, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension AppIntegrations {
    /// Return PaginatorSequence for operation ``listApplicationAssociations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationAssociationsPaginator(
        _ input: ListApplicationAssociationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListApplicationAssociationsRequest, ListApplicationAssociationsResponse> {
        return .init(
            input: input,
            command: self.listApplicationAssociations,
            inputKey: \ListApplicationAssociationsRequest.nextToken,
            outputKey: \ListApplicationAssociationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listApplicationAssociations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - applicationId: A unique identifier for the Application.
    ///   - maxResults: The maximum number of results to return per page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationAssociationsPaginator(
        applicationId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListApplicationAssociationsRequest, ListApplicationAssociationsResponse> {
        let input = ListApplicationAssociationsRequest(
            applicationId: applicationId, 
            maxResults: maxResults
        )
        return self.listApplicationAssociationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listApplications(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationsPaginator(
        _ input: ListApplicationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListApplicationsRequest, ListApplicationsResponse> {
        return .init(
            input: input,
            command: self.listApplications,
            inputKey: \ListApplicationsRequest.nextToken,
            outputKey: \ListApplicationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listApplications(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to return per page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListApplicationsRequest, ListApplicationsResponse> {
        let input = ListApplicationsRequest(
            maxResults: maxResults
        )
        return self.listApplicationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDataIntegrationAssociations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDataIntegrationAssociationsPaginator(
        _ input: ListDataIntegrationAssociationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDataIntegrationAssociationsRequest, ListDataIntegrationAssociationsResponse> {
        return .init(
            input: input,
            command: self.listDataIntegrationAssociations,
            inputKey: \ListDataIntegrationAssociationsRequest.nextToken,
            outputKey: \ListDataIntegrationAssociationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDataIntegrationAssociations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - dataIntegrationIdentifier: A unique identifier for the DataIntegration.
    ///   - maxResults: The maximum number of results to return per page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listDataIntegrationAssociationsPaginator(
        dataIntegrationIdentifier: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDataIntegrationAssociationsRequest, ListDataIntegrationAssociationsResponse> {
        let input = ListDataIntegrationAssociationsRequest(
            dataIntegrationIdentifier: dataIntegrationIdentifier, 
            maxResults: maxResults
        )
        return self.listDataIntegrationAssociationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listDataIntegrations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listDataIntegrationsPaginator(
        _ input: ListDataIntegrationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListDataIntegrationsRequest, ListDataIntegrationsResponse> {
        return .init(
            input: input,
            command: self.listDataIntegrations,
            inputKey: \ListDataIntegrationsRequest.nextToken,
            outputKey: \ListDataIntegrationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listDataIntegrations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to return per page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listDataIntegrationsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListDataIntegrationsRequest, ListDataIntegrationsResponse> {
        let input = ListDataIntegrationsRequest(
            maxResults: maxResults
        )
        return self.listDataIntegrationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listEventIntegrationAssociations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listEventIntegrationAssociationsPaginator(
        _ input: ListEventIntegrationAssociationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListEventIntegrationAssociationsRequest, ListEventIntegrationAssociationsResponse> {
        return .init(
            input: input,
            command: self.listEventIntegrationAssociations,
            inputKey: \ListEventIntegrationAssociationsRequest.nextToken,
            outputKey: \ListEventIntegrationAssociationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listEventIntegrationAssociations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - eventIntegrationName: The name of the event integration.
    ///   - maxResults: The maximum number of results to return per page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listEventIntegrationAssociationsPaginator(
        eventIntegrationName: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListEventIntegrationAssociationsRequest, ListEventIntegrationAssociationsResponse> {
        let input = ListEventIntegrationAssociationsRequest(
            eventIntegrationName: eventIntegrationName, 
            maxResults: maxResults
        )
        return self.listEventIntegrationAssociationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listEventIntegrations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listEventIntegrationsPaginator(
        _ input: ListEventIntegrationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListEventIntegrationsRequest, ListEventIntegrationsResponse> {
        return .init(
            input: input,
            command: self.listEventIntegrations,
            inputKey: \ListEventIntegrationsRequest.nextToken,
            outputKey: \ListEventIntegrationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listEventIntegrations(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The maximum number of results to return per page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listEventIntegrationsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListEventIntegrationsRequest, ListEventIntegrationsResponse> {
        let input = ListEventIntegrationsRequest(
            maxResults: maxResults
        )
        return self.listEventIntegrationsPaginator(input, logger: logger)
    }
}

extension AppIntegrations.ListApplicationAssociationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppIntegrations.ListApplicationAssociationsRequest {
        return .init(
            applicationId: self.applicationId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension AppIntegrations.ListApplicationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppIntegrations.ListApplicationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension AppIntegrations.ListDataIntegrationAssociationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppIntegrations.ListDataIntegrationAssociationsRequest {
        return .init(
            dataIntegrationIdentifier: self.dataIntegrationIdentifier,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension AppIntegrations.ListDataIntegrationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppIntegrations.ListDataIntegrationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension AppIntegrations.ListEventIntegrationAssociationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppIntegrations.ListEventIntegrationAssociationsRequest {
        return .init(
            eventIntegrationName: self.eventIntegrationName,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension AppIntegrations.ListEventIntegrationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> AppIntegrations.ListEventIntegrationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
